﻿
@{
    ViewBag.Title = "DingDan";
    Layout = "~/Views/Shared/DocInfos.cshtml";
}

<h2>DingDan</h2>
<link href="~/Content/bootstrap.css" rel="stylesheet" />
<script src="~/Scripts/jquery-1.10.2.js"></script>
<table>
    <tr>
        <td>
            <select id="state" class="form-control">
                <option value="">所有订单</option>
            </select>
        </td>
        <td>
            <select id="hospital" class="form-control">
                <option>请选择医院</option>
            </select>
        </td>
       
        <td>
            <input id="date1" type="date"/>
        </td>
        <td>
            <input id="date2" type="date"/>
        </td>
        <td>
            <input id="bencha" type="button" value="查询" class="btn-primary" />
        </td>
    </tr>
</table>

     
   
<table class="table-bordered">
    <thead>
        <tr>
            <td>编号</td>
            <td>订单状态</td>
            <td>下单用户</td>
            <td>下单时间</td>
            <td>体检人</td>
            <td>体检电话</td>
            <td>体检日期</td>
            <td>套餐</td>
            <td>医院</td>
            <td>支付金额</td>
            <td>医院价格</td>
            <td>优惠券</td>

        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>@item.T_OrderForm_ID</td>
                <td>@item.T_OrderForm_State_Name</td>
                <td>@item.T_OrderForm_UserName</td>
                <td>@item.T_OrderForm_Time</td>
                <td>@item.T_OrderForm_Name</td>
                <td>@item.T_OrderForm_Phone</td>
                <td>@item.T_OrderForm_DateTime</td>
                <td>@item.T_Combo_Name</td>
                <td>@item.T_Doc_Name</td>
                <td>@item.T_Combo_Price</td>
                <td>@item.T_OrderForm_DoctorPrice</td>
                <td>@item.T_Discount_Name</td>

            </tr>
        }
    </tbody>

</table>
<script>
    //获取支付状态
    $.getJSON(
        "/DocInfos/GetState",
        function (data)
        {
            $.each(data, function (i,item) {
                $("<option></option>").val(item["T_OrderForm_State_ID"]).text(item["T_OrderForm_State_Name"]).appendTo($("#state"))

            })
        }
        )
    //获取医院
    $.getJSON(
        "/DocInfos/GetHospital",
        function (data)
        {
            $.each(data, function (i, item) {
                $("<option></option>").val(item["T_Doc_ID"]).text(item["T_Doc_Name"]).appendTo($("#hospital"))
            })            
        }
        )
    $.ready(function () {

        $("#date1").val("2001-1-30");
        $("#date2").val("2999-1-6");

    })
    //查询
    $("#bencha").click(function () {
        debugger
        var sid = $("#state").val();
        var yid = $("#hospital").val();
        var stime = $("#date1").val();
        var etime = $("#date2").val();
        //alert(sid);
        //alert(yid);
        //alert(stime);
        //alert(etime);
        location.href = "/DocInfos/DingDan?sid=" + sid + "&yid=" + yid + "&stime=" + stime + "&etime=" + etime;
        //$.ajax({
        //    url: '/DocInfos/DingDan',
        //    type:'post',
        //    data: {sid:sid},
        //    success: function (item)
        //    {
        //        if(item>0)
        //        {
        //            alert("s");
        //        }
        //    }
        //})

    })
</script>


